#GenerateCalibrationFile.py
""" generates the calibration file """

import csv
import numpy as np
import numpy.matlib
import datetime
import time
import PBAR_Zspec

# Location of data
basepath = r'C:\Users\jkwong\Documents\Work\PBAR\data'

# Create list of datasets
(filenameList, fullfilenameList) = \
               PBAR_Zspec.GenerateDefaultDatasetFilenameList(basepath)

# LISTS OF DATASETS GROUPS
(datasetGroups, datasetGroupsIndices) = \
                PBAR_Zspec.GenerateDefaultDatasetGroupList(filenameList)

# list of good/bad detectors
(goodDetectorsList, badDetectorsList) = \
                    PBAR_Zspec.GenerateDefaultDetectorList()

# Load summary data
infoFilename = basepath + '\\' + 'datasetSummaryOLD.txt'

(datasetDescription, datasetAcquisitionTime, \
 datasetTime, datasetTimeNum, datasetTimeStr) = \
 PBAR_Zspec.GetDatasetInformation(infoFilename, filenameList)

## Load zspec data
#dat = PBAR_Zspec.ReadZspec(fullfilenameList)
#PBAR_Zspec.CreateGainCorrectionFile